<%@ page import="com.dailyblue.java.servlet.jsp.bean.Emp" %>
<%@ page import="com.dailyblue.java.servlet.jsp.dao.EmpDAO" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/1
  Time: 17:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setCharacterEncoding("utf-8");
    // 接收6个参数
    String ename = request.getParameter("ename");
    String job = request.getParameter("job");
    int mgr = Integer.parseInt(request.getParameter("mgr"));
    double sal = Double.parseDouble(request.getParameter("sal"));
    double comm = Double.parseDouble(request.getParameter("comm"));
    int deptNo = Integer.parseInt(request.getParameter("deptNo"));
    // 封装
    Emp emp = new Emp(ename, job, mgr, sal, comm, deptNo);
    // 调用方法
    EmpDAO dao = new EmpDAO();
    dao.saveEmp(emp);
    // 跳转到查询的页面5.jsp
    response.sendRedirect("5.jsp");
%>